import request from '../../utils/request.js'

// 获取我的标签
export const getMyTag = (uid) => request({
	url: `/tags/allTag/${uid}`,
	method: "get"
})

// 获取获取我的分类
export const getMyCategory = (uid) => request({
	url: `/categorys?uid=${uid}`,
	method: "get"
})


// 发布文章 /articles/publish
export const publish = (data,token) => request({
	 headers: {'Authorization': token},
	url: '/articles/publish',
	method: "post",
	data
})


// 上传图片 /upload post
export const upload = (data) => request({
	url: "/upload",
	method: "post",
	headers: {
		// 表示上传的是文件,而不是普通的表单数据
		'Content-Type': 'multipart/form-data'
	},
	data
})


// 修改文章
export const updateArticle = (data,token) => request({
	 headers: {'Authorization': token},
	url: '/articles/updateArticle',
	method: "post",
	data
})



